package com.swallow.cloud.controller;


import com.swallow.cloud.common.model.R;
import com.swallow.cloud.entity.SysOffice;
import com.swallow.cloud.service.OfficeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 * 部门表 前端控制器
 * </p>
 *
 * @author swallow
 * @since 2019-03-18
 */
@Controller
@RequestMapping("/sys/office")
public class SysOfficeController {


    @Autowired
    private OfficeService officeService;

    @RequestMapping("officeTree")
    @ResponseBody
    public Object officeTree(){
        List<SysOffice> list= officeService.list();
        return R.success(list);
    }
}
